<?php
//=========================
//Vuong Van Binh
//Wanbin@vietnambiz.com
//list & del faq
//=========================
include ADMIN_INCLUDE_DIR."/header.php";
//del_faq();
//del_multi_faq();
delMultiNote();
$rs_note = listNoteAll();

?>
<script>
function delNews(params,text){
    confirm_get("Do you want to delete "+text+"?",'<?php echo ADMIN_URL;?>'+params);
}
</script>
<style>
  	table.grid{
  		font-size:11px;
  		line-height:25px;
  		border-left:1px solid #D9E6F0;
  		border-top:1px solid #D9E6F0;
  	}
  	td.grid{
  		border-right:1px solid #D9E6F0;
  		border-bottom:1px solid #D9E6F0;
  		padding:2px;
        text-align: left;
  	}
    td.grid-c{
  		border-right:1px solid #D9E6F0;
  		border-bottom:1px solid #D9E6F0;
  		padding:2px;
        text-align: center;
  	}
  	th.grid{
  		border-right:1px solid #D9E6F0;
  		border-bottom:1px solid #D9E6F0;
  	}
  </style>
<div class="container_l">
		<div class="title_user"><img src="images/icon1.gif" />All FAQs


		</div>
		<div class="table_user">
			<form name="del_check" action="" method="post" id="form_del_check">
            <table cellpadding="0" cellspacing="0" width="100%" class="grid">
                <tr>
                    <th class="grid"><input type="checkbox" name="checkall" id="checkall" value="" /></th>
                    <th class="grid">Date</th>
                    <th class="grid">Message</th>
                    <th class="grid">Setting</th>
                </tr>
                <?php
					while($note=$db->fetch_array($rs_note["rs"])){

				?>
                <tr>
                    <td class="grid-c" style="width:5%;"><input type="checkbox" name="checkNote[]" id="check" class="check" value="<?php echo $note["id"]; ?>" /></td>
                    <td class="grid-c" style="width:20%;"><font class="textbody"><?php echo date('d/m/Y',strtotime($note['date']));?></font></td>
                    <td class="grid" style="width:65%;">
                        <?php
                        if(strlen($note["message"])>100)
                            echo split_char($note["message"],100,1).'...';
                        else
                            echo $note["message"];
                        ?>
                    </td>
                    <td class="grid-c" style="10%;">
                        <a href="<?php echo ADMIN_URL; ?>/index.php?module=note&action=detail&id=<?php echo $note["id"]; ?>&keepThis=true&TB_iframe=true&height=450&width=500" class="thickbox" >
                        <img src="images/profile.gif" alt="view" title="view" />
							</a>&nbsp;

							<a class="thickbox" href="index.php?module=note&id=<?php echo $note["id"]; ?>&action=edit&keepThis=true&TB_iframe=true&height=400&width=600"><img src="images/edit.gif" alt="Edit" title="Edit" /></a>
                            &nbsp;
							<a href="javascript: delNews('?module=note&action=del&page=<?php echo $rs_note['page'];?>&id=<?php echo $note['id'];?>','<?php echo htmlentities($note['message'], ENT_COMPAT, 'UTF-8');?>')"><img src="images/delete.gif" alt="Delete" title="Delete" /></a>
                    </td>
                </tr>
                <?php } ?>
                <tr>
                    <td colspan="4" class="grid">
                    <div class="boxbutton">
				    <input type="hidden" name="del_multi" value="okie" />
 					<input type="button" value="Delete checked" class="button" onclick="confirm_post('Are you sure to delete all checked','form_del_check');" />
					&nbsp;<a class="thickbox" href="index.php?module=note&action=add&keepThis=true&TB_iframe=true&height=400&width=600""><img src="images/addnew.gif" border="0" /></a>
				    </div>
                    <?php
				    // SHOW PAGING
				    if($rs_note["total"]>1){
				    echo "<div class='lineinbox'>";
					echo paging($rs_note["page"],$rs_note["total"],get_string_url());
					echo "</div>";
					}
				?>
                    </td>
                </tr>
            </table>
            </form>
    </div>
</div>

<?php
include "inc/right.php"; 
include ADMIN_INCLUDE_DIR."/footer.php"; 
?>